jQuery(document).ready(function(){
	$ = jQuery;
	var isScrolledIntoView = function(elem)
	{
	    var docViewTop = $(window).scrollTop();
	    var docViewBottom = docViewTop + $(window).height();
	    var elemTop = $(elem).offset().top;
	    var elemBottom = elemTop + $(elem).height();
	    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
	};
	var feathers = function(){
		$.each($('.feather'),function(k,v){
			var child = $(this).children('div');
			if(isScrolledIntoView($(this)))
			{
				if(!child.is(':animated') && child.css('width') == '0px')
				{
					child.animate({width:'100%'});
					child.children('div').fadeIn();
					$(this).removeClass('hidden');
				}
			}
			else
			{
				if(!child.is(':animated') && child.css('width') != '0px')
				{
					child.animate({width:0});
					child.children('div').fadeOut();
					$(this).addClass('hidden');
				}
			}
		});
	};
	$(document).scroll(function(){
		feathers();
	});
	$(window).resize(function(){
		feathers();
	});
	feathers();
});